<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>产品类型</title>
<%@ include file="/common/include.jsp"%>
<link href="/summer/template/admin/css/list.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/summer/template/admin/js/list.js"></script>
<meta name="Author" content="Summer++ Team" />
<meta name="Copyright" content="SUMMER" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<script type="text/javascript">

$().ready( function() {

	   $("#itemCatname").autocomplete("item_cat!serachName.action", {   
	        multiple: true,     
	        width:400,     
	        max:50,     
	        multipleSeparator: ' ',   
	        dataType: 'json',     
	        extraParams: {   
	            "itemCat.name": function(){return $("#itemCatname").val();},
	  			"itemCat.id": function(){return $("#itemCatId").val();}
	        },   
	        
	      //加入对返回的json对象进行解析函数，函数返回一个数组       
	        parse: function(data) {   
	         var rows = [];  
	         for(var i=0; i<data.length; i++){   
	           rows[rows.length] = {   
	             data:data[i].name.replace(/^\s+|\s+$/g,""),   
	             value:data[i].name.replace(/^\s+|\s+$/g,""),   
	             result:data[i].name.replace(/^\s+|\s+$/g,"")   
	             };   
	           }   
	       return rows;   
	          },   
	        formatItem: function(row, i, n) {   
	          return row;         
	       }   
	    });  


	   var $importButton = $('#import');// 导入单个类目商品
	   var $importOneButton = $('#importOne');// 导入单个商品
	   var $importMoreButton = $('#importMore');// 导入搜索商品

	   var $radioShop =$("input[name='shopid']");        

	   
	   var $idsCheck = $(".list input[name='ids']");// ID复选框
	// 无复选框被选中时,删除按钮不可用
		$idsCheck.click( function() {
			
			var $idsChecked = $(".list input[name='ids']:checked");
			if ($idsChecked.size() ==1) {
				$importButton.attr("disabled", false);
			} else {
				$importButton.attr("disabled", true)
			}
		});

	  
		$importButton.click(function(){
			var url = $(this).attr("url");
			
			if (confirm("您确定要 导入单个类目商品么？") == true) {
				document.getElementById("listForm").action=url;
				document.getElementById("listForm").submit();
			}
			});

		$importOneButton.click(function(){
				var url = $(this).attr("url");
			if (confirm("您确定要 导入单个商品么？") == true) {
				document.getElementById("listForm").action=url;
				document.getElementById("listForm").submit();
			}


		});

		$importMoreButton.click(function(){
			var url = $(this).attr("url");
		if (confirm("您确定要 导入搜索商品么？") == true) {
			document.getElementById("listForm").action=url;
			document.getElementById("listForm").submit();
		}

		

		


	});
 
		$radioShop.click(function(){
			var id = $(this).attr("value");
			document.getElementById("listForm").action="/summer/price/ptype!list.action?shopid="+id;
			document.getElementById("listForm").submit();
		});

	   
});




</script>
</head>
<body class="list">

<s:set name="pid" value=""></s:set>
<s:set name="pid_2" value=""></s:set>
<form id="listForm" action="ptype!importTaoBaoGoods.action" method="post">
	<div style=""><b>选择商店</b><s:iterator value="shopList" var="dbshop"><s:radio list="#dbshop" listKey="id" listValue="cnName" key="shopid" value="#{shopid}"   ></s:radio> </s:iterator> </div>
	<div style="float: left">导入数量<input type="text" name="num" size="6" ></div><div style="float: left">价格下限<input type="text" name="price" size="6" ></div>  
	<div style="float: left">淘宝类目<input type="text" id="itemCatname" name="itemCat.name" style="size: 40" ><input type="hidden" id="itemCatId" name="itemCat.Id"></input></div> <div><input type="button" id="import" value="导入单个类目商品" url="ptype!importTaoBaoGoods.action"  /></div>
	<div style="float: left">商品地址<input type="text" id="goodUrl" name="goodUrl"  style="width: 100"></div><div><input type="button" id="importOne" value="导入单个商品" url="ptype!importTaoBaoGood.action"  /></div> 
	<div style="float: left">搜索地址<input type="text" id="goodsUrl" name="goodsUrl" style="width: 100"></div><div><input type="button" id="importMore" value="导入搜索商品" url="ptype!importTaoBaoGoods.action" /></div> 
	<div style="float: left">店铺类目</div>
	<div>
		<select name="shopCategoryId"><s:iterator value='#request.catList' ><option value='<s:property value="cid"/>'><s:property value="name"/></option> </s:iterator></select>
	</div> 
	<div style="float: left">快递价格</div>
	<div>
		<select name="postId"><option value='0'>卖家包邮</option><s:iterator value='#request.postageList' ><option value='<s:property value="postageId"/>'><s:property value="name"/></option> </s:iterator></select>
	</div> 
	<div style="float: left">图片水印</div>
	<div>
		<select name="vedios"><option value='0'>无水印</option><option value='1'>联保包邮</option><option value='2'>包邮秒杀</option><option value='3'>特价秒杀</option><option value='-1'>随机</option></select>
	</div> 
	
<div>
<s:iterator value="pager.list" id="ptype">
<s:if test="ptype==null">
<div>
<h4><FONT color="red"><s:property value="name"/></FONT></h4>
<s:set name="pid" value="id"></s:set>
</div>
</s:if>
<s:if test="ptype.id==#pid">
<div>
<h5><s:property value="name"/></h5>

</div>
<s:set name="pid_2" value="id"></s:set>
</s:if>
<s:if test="ptype.id==#pid_2">
<a href="<s:property value="url" />" ><s:property value="name"/></a><input type="checkbox" id="ids" name="ids" value="<s:property value="id" />" />&nbsp;&nbsp;&nbsp;
</s:if>

</s:iterator>
<s:debug></s:debug>
</div>
</form>
</body>
</html>

 
